<html>
<title></title>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>

<body bgcolor="Thistle">
    <div id="app">
        <h1 align="center">欧美日三方专利被引情况查询</h1>
        <br>
        <br>
        <form align="center">
        国家:<br>
        <select name="" id="country" cols="10" rows="2" v-model="country" >
            <option value="ep">欧洲</option>
            <option value="us">美国</option>
            <option value="jp">日本</option>
        </select>
        <br>
        IPC:<br>
        <select name="" id="IPC" cols="10" rows="2" v-model="IPC" >
            <option value="A"> A </option>
            <option value="B"> B </option>
            <option value="C"> C </option>
            <option value="D"> D </option>
            <option value="E"> E </option>
            <option value="F"> F </option>
            <option value="G"> G </option>
            <option value="H"> H </option>
        </select>
        <br>
        公开年:<br>
        <textarea name="" id="i" cols="10" rows="2" v-model="i"></textarea>
        <br>
        统计年:<br>
        <textarea name="" id="j" cols="10" rows="2" v-model="j"></textarea>
        <br>
        <hr />
        当年公开专利数:<br>
        <textarea name="" id="count" cols="10" rows="2" v-model="count"></textarea>
        <br>
        专利被引数:<br>
        <textarea name="" id="gkn_count" cols="10" rows="2" v-model="gkn_count"></textarea>
        <br>
        专利被引均值:<br>
        <textarea name="" id="avg_count" cols="10" rows="2" v-model="avg_count"></textarea>
        <br>
        <input type="button" @click="addText" id="add-textarea" value="click me">
    </form>
   
    </div>

    <script>
        new Vue({
            el: "#app",
            data: {
                country: 'us',
                IPC:'A',
                i:1980,
                
                j:2000,
                count:"",
                gkn_count:"",
                avg_count:""
            },
            methods: {
                addText() {
                    return axios.post("/search", {
                        country: this.country,
                        IPC:this.IPC,
                        i:this.i,
                        j:this.j
                    }, {
                        headers: {
                            'Content-type': 'application/json',
                        }
                        // isSave=True
                    }).then((response) => {
                        // console.log(response);
                        data=response.data;
                        this.count=data.count;
                        this.gkn_count=data.gkn_count;
                        this.avg_count=data.avg_count;
                        // console.log("country: " + this.country);
                    });
                }
            }
        });
    </script>
</body>
</html>